home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Pressing the Escape key will exit this screen saver. The value you place
- ; in the GoodPass Variable (next line) will be required to exit.
- ;
- Variable GoodPass,20,'PowerBatch'
- Variable CurrClr,3 ;curr color when we start
- Variable Pass,20,''
- Variable Work,80
- Variable InChar,1
- Variable Esc,1,#27
- Variable Lgth,2 ;string length
- Variable OffSet,2 ;offset within the box
- Variable Spec,1 ;tells us if we time out
- Variable XLoc,2 ;left X
- Variable YLoc,2 ;upper Y
- Variable X2Loc,2 ;right X
- Variable Y2Loc,2 ;lower Y
- Variable WinUX,2 ;window upper x
- Variable WinUY,2 ;window upper y
- Variable WinLX,2 ;lower x
- Variable WinLY,2 ;lower y
- Variable PassX,2
- Variable PassY,2
- Variable WXLoc,2 ;work
- Variable WYLoc,2
- Variable XAdjust,2
- Variable Clr,3,224
- Variable Normal,1,1
- Variable Off,1,2
- Variable Months,108,'January February March April May June July August SeptemberOctober November December '
- Variable CurrMonth,9
- Variable HLine,40,'├──────────────────────────────────────┤'
- Variable Secs,2
- Variable CurrTime,11
- Variable Month,2
- Variable Day,2
- Variable Year,4
- Variable MsgName,27,''
- Variable Msg,255,'Enter your name and a brief message..'
- ?Color Work,Work,CurrClr ;get curr sys color
- EnhanClr 1 ;enhanced colors on
-
- Label WaitLoop
- Window0 1,1,80,25
- SetVar Secs,0 ;init our counter
- Cursor Off ;turn cursor off
- Random 39,XLoc ;get a random X
- Add XLoc,1 ;cant be zero
- SetVar X2Loc,XLoc ;calculate box right side
- Add X2Loc,39
- SetVar WinUX,XLoc ;for our msg window
- Add WinUX,1
- SetVar PassX,XLoc ;for password?
- Add PassX,1
- Random 11,YLoc ;get a random Y
- Add YLoc,1 ;cant be zero
- SetVar Y2Loc,YLoc ;calculate box bottom
- Add Y2Loc,12
- SetVar WinUY,YLoc ;for our msg window
- Add WinUY,6
- SetVar PassY,Y2Loc ;for password?
- Subtract PassY,1
- SetVar WinLX,X2Loc
- Subtract WinLX,2
- SetVar WinLY,Y2Loc
- Subtract WinLY,2
- ?Date Work,Month,Day,Year ;get the date
- Subtract Month,1 ;use it as an offset in our tbl
- Multiply Month,9 ;each entry is 9 long
- Compare Month,0,MonthOK ;first entry is 1
- Add Month,1
- Label MonthOK
- Add Month,1
- MidString CurrMonth,Months,Month,9 ;get the name from the table
- Trim CurrMonth ;trim the trailing spaces
- Concat Work,CurrMonth,' ',Day,', ',Year ;pretty up the date
- Clear 0
- Color Clr
- Box1 XLoc,YLoc,X2Loc,Y2Loc,Clr ;draw our box
- SetVar WYLoc,YLoc
- Add WYLoc,3
- WriteAt XLoc,WYLoc,HLine,Clr
- Add WYLoc,2
- WriteAt XLoc,WYLoc,HLine,Clr
- SetVar WXLoc,XLoc
- Add WXLoc,15
- WriteAt WXLoc,WYLoc,'┤Message├'
- Subtract WYLoc,1
- Subtract WXLoc,14
- WriteAt WXLoc,WYLoc,'Your Name '
- Write ' ',180
- Add WXLoc,10
- WriteAt WXLoc,WYLoc,MsgName,184
- Subtract WXLoc,10
- Window0 WinUX,WinUY,WinLX,WinLY
- Write Msg
- Window0 1,1,80,25
- SetVar WYLoc,YLoc
- Add WYLoc,1
- WriteAt WXLoc,WYLoc,' Leave Me A Message ',20
- Add WYLoc,1
- WriteAt WXLoc,WYLoc,Work ;date
- SetVar WXLoc,XLoc
- Add WXLoc,10
- WriteAt WXLoc,Y2Loc,' PowerBatch Ver 2.2 ' ;write our first line
- SetVar WXLoc,XLoc
- SetVar WYLoc,YLoc
- Add WYLoc,2 ;adjust Y for the next line
- Add WXLoc,1 ;calculate location for date
- WriteAt WXLoc,WYLoc,Work ;write date since it may change
- SetVar WXLoc,X2Loc
- Subtract WXLoc,11
- Add XLoc,11
- Add YLoc,4
- Label TimeLoop ;get the time each loop
- ?Time CurrTime ;update time
- WriteAt WXLoc,WYLoc,CurrTime
- GoToXY XLoc,YLoc
- Color 180
- Cursor Normal
- ReadKey InChar,Spec,1
- Compare InChar,'',TakeMsg ;key entered?
- Color Clr
- Add Secs,1 ;no key
- Compare Secs,10,WaitLoop,TimeLoop,WaitLoop ;big loop or small loop
-
- Label TakeMsg
- Compare InChar,Esc,,,End
- SetVar Msg,''
- ReadStr MsgName
- Color Clr
- Concat MsgName,InChar,MsgName
- Window0 WinUX,WinUY,WinLX,WinLY
- Clear
- ReadStr Msg
- GoTo WaitLoop
-
- Label End
- Color Clr
- WriteAt PassX,PassY,'PassWord:'
- ReadStr Pass
- Compare Pass,GoodPass,WaitLoop,WaitLoop
- Color CurrClr ;restore colors
- EnhanClr 0 ;set regular colors
- Clear CurrClr ;and clear the screen
-